import axios from './ajax';
import type { RESDataType } from './ajax';

export async function getStatList(
  questionId: string,
  opt: { page: number; pageSize: number }
): Promise<RESDataType> {
  const res = await axios.get(`/api/stat/${questionId}`, { params: opt });
  return res;
}

export async function getComponentStat(
  questionId: string,
  componentId: string
): Promise<RESDataType> {
  const res = await axios.get(`/api/stat/${questionId}/${componentId}`);
  return res;
}
